DROP TABLE IF EXISTS books;
CREATE TABLE books(id BIGINT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(255), author_id BIGINT, genre_id BIGINT);

DROP TABLE IF EXISTS authors;
CREATE TABLE authors(id BIGINT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(255));

DROP TABLE IF EXISTS genres;
CREATE TABLE genres(id BIGINT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(255));

DROP TABLE IF EXISTS comments;
CREATE TABLE comments(id BIGINT PRIMARY KEY AUTO_INCREMENT, text text, book_id bigint references books(id) on delete cascade);